package com.nanyang.tms.api.dto.request.product.add;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * <p>Description:(服务商产品计重模式信息表)</p>
 *
 * @author lv
 * @date 2022年11月12日 下午05:06:46
 * @Copyright Copyright (c) 2020 www.nanyang.cn Inc. All rights reserved.
 */
@Data
public class ProductWeightModelAddRequest implements Serializable {
    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;


    /**
     * 计重模式类型编码
     */
    @NotEmpty(message = "计重模式类型编码不能为空")
    @Length(max = 20, message = "modelTypeCode长度需小于20个字符")
    private String modelTypeCode;

    /**
     * 计重模式类型名称
     */
    @NotEmpty(message = "计重模式类型名称不能为空")
    @Length(max = 30, message = "modelTypeName长度需小于30个字符")
    private String modelTypeName;

    /**
     * 件最低重量类型编码
     */
    @Length(max = 20, message = "lowWeightTypeCode长度需小于20个字符")
    private String lowWeightTypeCode;

    /**
     * 件最低重量类型编码
     */
    @Length(max = 30, message = "lowWeightTypeName长度需小于30个字符")
    private String lowWeightTypeName;

    /**
     * 件最低重量数值（kg）
     */
    @Digits(integer = 9, fraction=2, message = "lowWeightValue格式不正确")
    @DecimalMin(value = "0.00", message = "lowWeightValue格式不正确")
    private BigDecimal lowWeightValue;

    @Valid
    @NotNull(message = "productWeightRuleAddRequestList不能为空")
    private List<ProductWeightRuleAddRequest> productWeightRuleAddRequestList;
}